import React, { Component } from "react";
import { connect } from "react-redux";
import "./RepaymentSuccess.scss";
import Header from "../../../component/header/Header";
class RepaymentSuccess extends Component {
	constructor(props) {
		super(props);
	}
	componentDidMount() {}
	//底部按钮跳转
	gotoPage = index => {
		if (index == 1) {
			//去首页
			window.location.replace("#/tabPage");
		} else if (this.props.loanProcessDataReducer.souceId == "loanDetail") {
			//到借款详情
			this.props.history.push("/loanDetail");
		} else {
			//到账单首页
			this.props.history.push("/bill");
		}
	};
	render() {
		let headerParams = {
			phoneStyle: this.props.getAppPlatformsDatas.phoneX,
			title: "还款成功"
		};
		return (
			<div
				className={this.props.getAppPlatformsDatas.phoneX ? "pt168" : "pt128"}
			>
				<Header objParams={headerParams} />
				{/*<Header  phoneStyle={this.props.getAppPlatformsDatas.phoneX} title='还款成功'/>*/}
				<div className="repayment-success-page">
					<div className="content-body" id="contentBody">
						<img
							className="top-img"
							src={require("../../../images/icon-bank-transfer-success.png")}
						/>
						<div className="edu-status-div">
							<div className="center-bottom-tips-div center-0-tips">
								<div className="contract-span">
									支付操作完成，我们将会在5分钟内为您处理借款，请耐心等待。
								</div>
							</div>
						</div>
					</div>
					<div className="bottom-div">
						<a
							className="submit-btn btn-grey"
							id="bottomDom"
							onClick={this.gotoPage.bind(this, 1)}
						>
							去首页
						</a>
						<a
							className="submit-btn"
							id="bottomDom"
							onClick={this.gotoPage.bind(this, 2)}
						>
							查看详情
						</a>
					</div>
				</div>
			</div>
		);
	}
}

function mapStateToProps(state) {
	return state;
}
function mapDispatchToProps() {
	return {};
}
const RepaymentSuccessPage = connect(
	mapStateToProps,
	mapDispatchToProps
)(RepaymentSuccess);
export default RepaymentSuccessPage;
